{extend name="../../admin/view/main"}

{block name="button"}
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal='{:url("add")}'>添加公证处</button>
<button class='layui-btn layui-btn-sm layui-btn-primary' data-action='{:url("remove")}' data-confirm="确定要删除这些充值记录吗？" data-rule="id#{key}">批量删除</button>
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='notarialoffice/notarialoffice/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>公证处信息</th>
            <th class='text-left nowrap'>启用状态</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
            </td>
            <td class="nowrap">
<!--                <div class="headimg headimg-md" data-lazy-src="{$vo.user.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>-->
                <div class="inline-block">
                    <div>名称：<span class="color-text">{$vo.name|default='--'}</span></div>
<!--                    <div>用户手机：<span class="color-text">{$vo.user.phone|default='&#45;&#45;'}</span></div>-->
                </div>
            </td>
            <td class='nowrap'>
                <div>
                    <span>{if $vo.status eq 0}<b class="color-red">禁用</b>{elseif $vo.status eq 1}<b class="color-green">启用</b>{/if}</span>
                </div>
            </td>
            <td class="nowrap">
                <a class="layui-btn layui-btn-sm" data-title="编辑公证处" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除数据吗?" data-value="id#{$vo.id}">删 除</a>
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">启用</a>
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state')}" data-confirm="确定禁用吗？" data-value="id#{$vo.id};status#0">禁用</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>

<!-- 数据状态切换模板 -->
<script type="text/html" id="StatusSwitchTpl">
    <!--{if auth("state")}-->
    <input type="checkbox" value="{{d.sps}}|{{d.spp}}" lay-text="已激活|已禁用" lay-filter="StatusSwitch" lay-skin="switch" {{-d.status>0?'checked':''}}>
    <!--{else}-->
    {{-d.status ? '<b class="color-green">已激活</b>' : '<b class="color-red">已禁用</b>'}}
    <!--{/if}-->
</script>
{/block}